package cosu.controller;


import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


import com.github.pagehelper.PageInfo;
import com.mybatis.page.pageFactory;

import cosu.entry.User;
import cosu.feign.PrivderClient;
import cosu.service.UserServiceImpl;


@RestController
public class ComController {

	@GetMapping("/com")
	private Object getCom() {
		return "xf";
	}

	@Autowired
	private PrivderClient client;

	@GetMapping("/test1")
	public String get1() {
		String param = "{'username':'admin'}";
		String res= client.echo(param);
		return res;
	}
	
	
	@Autowired
	private UserServiceImpl  userService;
	
	@GetMapping("/list")
	public  Object  findAll() {

		
		return userService.find();
	}
	
	@GetMapping("/insert")
	public  Object  insert(Integer type) {
		User user = new User();
		user.setUsername("12"+UUID.randomUUID());
		userService.insert(user,type);
		return 1/0;
	}
	
	
}
